<template>
    <div>
        C组件--{{ p }}
        <button @click="fn('lalllalala')">调用App方法</button>
    </div>
</template>

<script setup>
import { inject } from "vue";



//注入
const p = inject('gogo', '默认值')
const fn = inject('getData')

</script>

<style lang="scss" scoped></style>